//add fcounty for North Carolina
// first associate each mcd with county. Then county to fips
// fips codes accessed here: https://www.nrcs.usda.gov/wps/portal/nrcs/detail/national/home/?cid=nrcs143_013697
// mcd to county accessed here: https://www.census.gov/geo/reference/codes/place.html


gen fcounty=.

replace fcounty=1 if county=="ALAMANCE" & state=="North Carolina"
replace fcounty=3 if county=="ALEXANDER" & state=="North Carolina"
replace fcounty=5 if county=="ALLEGHANY" & state=="North Carolina"
replace fcounty=7 if county=="ANSON" & state=="North Carolina"
replace fcounty=9 if county=="ASHE" & state=="North Carolina"
replace fcounty=11 if county=="AVERY" & state=="North Carolina"
replace fcounty=13 if county=="BEAUFORT" & state=="North Carolina"
replace fcounty=15 if county=="BERTIE" & state=="North Carolina"
replace fcounty=17 if county=="BLADEN" & state=="North Carolina"
replace fcounty=19 if county=="BRUNSWICK" & state=="North Carolina"
replace fcounty=21 if county=="BUNCOMBE" & state=="North Carolina"
replace fcounty=23 if county=="BURKE" & state=="North Carolina"
replace fcounty=25 if county=="CABARRUS" & state=="North Carolina"
replace fcounty=27 if county=="CALDWELL" & state=="North Carolina"
replace fcounty=29 if county=="CAMDEN" & state=="North Carolina"
replace fcounty=31 if county=="CARTERET" & state=="North Carolina"
replace fcounty=33 if county=="CASWELL" & state=="North Carolina"
replace fcounty=35 if county=="CATAWBA" & state=="North Carolina"
replace fcounty=37 if county=="CHATHAM" & state=="North Carolina"
replace fcounty=39 if county=="CHEROKEE" & state=="North Carolina"
replace fcounty=41 if county=="CHOWAN" & state=="North Carolina"
replace fcounty=43 if county=="CLAY" & state=="North Carolina"
replace fcounty=45 if county=="CLEVELAND" & state=="North Carolina"
replace fcounty=47 if county=="COLUMBUS" & state=="North Carolina"
replace fcounty=49 if county=="CRAVEN" & state=="North Carolina"
replace fcounty=51 if county=="CUMBERLAND" & state=="North Carolina"
replace fcounty=53 if county=="CURRITUCK" & state=="North Carolina"
replace fcounty=55 if county=="DARE" & state=="North Carolina"
replace fcounty=57 if county=="DAVIDSON" & state=="North Carolina"
replace fcounty=59 if county=="DAVIE" & state=="North Carolina"
replace fcounty=61 if county=="DUPLIN" & state=="North Carolina"
replace fcounty=63 if county=="DURHAM" & state=="North Carolina"
replace fcounty=65 if county=="EDGECOMBE" & state=="North Carolina"
replace fcounty=67 if county=="FORSYTH" & state=="North Carolina"
replace fcounty=69 if county=="FRANKLIN" & state=="North Carolina"
replace fcounty=71 if county=="GASTON" & state=="North Carolina"
replace fcounty=73 if county=="GATES" & state=="North Carolina"
replace fcounty=75 if county=="GRAHAM" & state=="North Carolina"
replace fcounty=77 if county=="GRANVILLE" & state=="North Carolina"
replace fcounty=79 if county=="GREENE" & state=="North Carolina"
replace fcounty=81 if county=="GUILFORD" & state=="North Carolina"
replace fcounty=83 if county=="HALIFAX" & state=="North Carolina"
replace fcounty=85 if county=="HARNETT" & state=="North Carolina"
replace fcounty=87 if county=="HAYWOOD" & state=="North Carolina"
replace fcounty=89 if county=="HENDERSON" & state=="North Carolina"
replace fcounty=91 if county=="HERTFORD" & state=="North Carolina"
replace fcounty=93 if county=="HOKE" & state=="North Carolina"
replace fcounty=95 if county=="HYDE" & state=="North Carolina"
replace fcounty=97 if county=="IREDELL" & state=="North Carolina"
replace fcounty=99 if county=="JACKSON" & state=="North Carolina"
replace fcounty=101 if county=="JOHNSTON" & state=="North Carolina"
replace fcounty=103 if county=="JONES" & state=="North Carolina"
replace fcounty=105 if county=="LEE" & state=="North Carolina"
replace fcounty=107 if county=="LENOIR" & state=="North Carolina"
replace fcounty=109 if county=="LINCOLN" & state=="North Carolina"
replace fcounty=111 if county=="MCDOWELL" & state=="North Carolina"
replace fcounty=113 if county=="MACON" & state=="North Carolina"
replace fcounty=115 if county=="MADISON" & state=="North Carolina"
replace fcounty=117 if county=="MARTIN" & state=="North Carolina"
replace fcounty=119 if county=="MECKLENBURG" & state=="North Carolina"
replace fcounty=121 if county=="MITCHELL" & state=="North Carolina"
replace fcounty=123 if county=="MONTGOMERY" & state=="North Carolina"
replace fcounty=125 if county=="MOORE" & state=="North Carolina"
replace fcounty=127 if county=="NASH" & state=="North Carolina"
replace fcounty=129 if county=="NEW HANOVER" & state=="North Carolina"
replace fcounty=131 if county=="NORTHAMPTON" & state=="North Carolina"
replace fcounty=133 if county=="ONSLOW" & state=="North Carolina"
replace fcounty=135 if county=="ORANGE" & state=="North Carolina"
replace fcounty=137 if county=="PAMLICO" & state=="North Carolina"
replace fcounty=139 if county=="PASQUOTANK" & state=="North Carolina"
replace fcounty=141 if county=="PENDER" & state=="North Carolina"
replace fcounty=143 if county=="PERQUIMANS" & state=="North Carolina"
replace fcounty=145 if county=="PERSON" & state=="North Carolina"
replace fcounty=147 if county=="PITT" & state=="North Carolina"
replace fcounty=149 if county=="POLK" & state=="North Carolina"
replace fcounty=151 if county=="RANDOLPH" & state=="North Carolina"
replace fcounty=153 if county=="RICHMOND" & state=="North Carolina"
replace fcounty=155 if county=="ROBESON" & state=="North Carolina"
replace fcounty=157 if county=="ROCKINGHAM" & state=="North Carolina"
replace fcounty=159 if county=="ROWAN" & state=="North Carolina"
replace fcounty=161 if county=="RUTHERFORD" & state=="North Carolina"
replace fcounty=163 if county=="SAMPSON" & state=="North Carolina"
replace fcounty=165 if county=="SCOTLAND" & state=="North Carolina"
replace fcounty=167 if county=="STANLY" & state=="North Carolina"
replace fcounty=169 if county=="STOKES" & state=="North Carolina"
replace fcounty=171 if county=="SURRY" & state=="North Carolina"
replace fcounty=173 if county=="SWAIN" & state=="North Carolina"
replace fcounty=175 if county=="TRANSYLVANIA" & state=="North Carolina"
replace fcounty=177 if county=="TYRRELL" & state=="North Carolina"
replace fcounty=179 if county=="UNION" & state=="North Carolina"
replace fcounty=181 if county=="VANCE" & state=="North Carolina"
replace fcounty=183 if county=="WAKE" & state=="North Carolina"
replace fcounty=185 if county=="WARREN" & state=="North Carolina"
replace fcounty=187 if county=="WASHINGTON" & state=="North Carolina"
replace fcounty=189 if county=="WATAUGA" & state=="North Carolina"
replace fcounty=191 if county=="WAYNE" & state=="North Carolina"
replace fcounty=193 if county=="WILKES" & state=="North Carolina"
replace fcounty=195 if county=="WILSON" & state=="North Carolina"
replace fcounty=197 if county=="YADKIN" & state=="North Carolina"
replace fcounty=199 if county=="YANCEY" & state=="North Carolina"
